{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----原始数据----\n",
      "    ID         Name  Test_1  Test_2  Test_3\n",
      "0    1  Student_001      41      31      54\n",
      "1    2  Student_002      86      22      59\n",
      "2    3  Student_003      54      25      68\n",
      "3    4  Student_004      82      36      92\n",
      "4    5  Student_005      55      99      93\n",
      "5    6  Student_006      86      12      50\n",
      "6    7  Student_007      91      11      54\n",
      "7    8  Student_008      20      98      52\n",
      "8    9  Student_009      74      85      63\n",
      "9   10  Student_010      28      98      99\n",
      "10  11  Student_011      35      83      85\n",
      "11  12  Student_012      23      48      67\n",
      "12  13  Student_013      45      62      90\n",
      "13  14  Student_014      63      26      56\n",
      "14  15  Student_015      50      64      70\n",
      "15  16  Student_016      69      31      96\n",
      "16  17  Student_017      98      78      55\n",
      "17  18  Student_018      65      74      95\n",
      "18  19  Student_019      95      51      61\n",
      "19  20  Student_020      83      72      82\n",
      "Index(['ID', 'Name', 'Test_1', 'Test_2', 'Test_3'], dtype='object')\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col3 {\n",
       "            color: black;\n",
       "            background-color: lime;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col4 {\n",
       "            color: black;\n",
       "            background-color: lime;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col2 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col2 {\n",
       "            color: black;\n",
       "            background-color: lime;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col4 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col3 {\n",
       "            color: red;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col2 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col3 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }    #T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col4 {\n",
       "            color: black;\n",
       "            background-color: white;\n",
       "        }</style>  \n",
       "<table id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760\" > \n",
       "<thead>    <tr> \n",
       "        <th class=\"blank level0\" ></th> \n",
       "        <th class=\"col_heading level0 col0\" >ID</th> \n",
       "        <th class=\"col_heading level0 col1\" >Name</th> \n",
       "        <th class=\"col_heading level0 col2\" >Test_1</th> \n",
       "        <th class=\"col_heading level0 col3\" >Test_2</th> \n",
       "        <th class=\"col_heading level0 col4\" >Test_3</th> \n",
       "    </tr></thead> \n",
       "<tbody>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row0\" class=\"row_heading level0 row0\" >0</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col0\" class=\"data row0 col0\" >1</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col1\" class=\"data row0 col1\" >Student_001</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col2\" class=\"data row0 col2\" >41</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col3\" class=\"data row0 col3\" >31</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row0_col4\" class=\"data row0 col4\" >54</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row1\" class=\"row_heading level0 row1\" >1</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col0\" class=\"data row1 col0\" >2</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col1\" class=\"data row1 col1\" >Student_002</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col2\" class=\"data row1 col2\" >86</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col3\" class=\"data row1 col3\" >22</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row1_col4\" class=\"data row1 col4\" >59</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row2\" class=\"row_heading level0 row2\" >2</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col0\" class=\"data row2 col0\" >3</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col1\" class=\"data row2 col1\" >Student_003</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col2\" class=\"data row2 col2\" >54</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col3\" class=\"data row2 col3\" >25</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row2_col4\" class=\"data row2 col4\" >68</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row3\" class=\"row_heading level0 row3\" >3</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col0\" class=\"data row3 col0\" >4</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col1\" class=\"data row3 col1\" >Student_004</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col2\" class=\"data row3 col2\" >82</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col3\" class=\"data row3 col3\" >36</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row3_col4\" class=\"data row3 col4\" >92</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row4\" class=\"row_heading level0 row4\" >4</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col0\" class=\"data row4 col0\" >5</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col1\" class=\"data row4 col1\" >Student_005</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col2\" class=\"data row4 col2\" >55</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col3\" class=\"data row4 col3\" >99</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row4_col4\" class=\"data row4 col4\" >93</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row5\" class=\"row_heading level0 row5\" >5</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col0\" class=\"data row5 col0\" >6</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col1\" class=\"data row5 col1\" >Student_006</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col2\" class=\"data row5 col2\" >86</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col3\" class=\"data row5 col3\" >12</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row5_col4\" class=\"data row5 col4\" >50</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row6\" class=\"row_heading level0 row6\" >6</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col0\" class=\"data row6 col0\" >7</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col1\" class=\"data row6 col1\" >Student_007</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col2\" class=\"data row6 col2\" >91</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col3\" class=\"data row6 col3\" >11</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row6_col4\" class=\"data row6 col4\" >54</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row7\" class=\"row_heading level0 row7\" >7</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col0\" class=\"data row7 col0\" >8</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col1\" class=\"data row7 col1\" >Student_008</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col2\" class=\"data row7 col2\" >20</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col3\" class=\"data row7 col3\" >98</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row7_col4\" class=\"data row7 col4\" >52</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row8\" class=\"row_heading level0 row8\" >8</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col0\" class=\"data row8 col0\" >9</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col1\" class=\"data row8 col1\" >Student_009</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col2\" class=\"data row8 col2\" >74</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col3\" class=\"data row8 col3\" >85</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row8_col4\" class=\"data row8 col4\" >63</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row9\" class=\"row_heading level0 row9\" >9</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col0\" class=\"data row9 col0\" >10</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col1\" class=\"data row9 col1\" >Student_010</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col2\" class=\"data row9 col2\" >28</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col3\" class=\"data row9 col3\" >98</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row9_col4\" class=\"data row9 col4\" >99</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row10\" class=\"row_heading level0 row10\" >10</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col0\" class=\"data row10 col0\" >11</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col1\" class=\"data row10 col1\" >Student_011</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col2\" class=\"data row10 col2\" >35</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col3\" class=\"data row10 col3\" >83</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row10_col4\" class=\"data row10 col4\" >85</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row11\" class=\"row_heading level0 row11\" >11</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col0\" class=\"data row11 col0\" >12</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col1\" class=\"data row11 col1\" >Student_012</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col2\" class=\"data row11 col2\" >23</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col3\" class=\"data row11 col3\" >48</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row11_col4\" class=\"data row11 col4\" >67</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row12\" class=\"row_heading level0 row12\" >12</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col0\" class=\"data row12 col0\" >13</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col1\" class=\"data row12 col1\" >Student_013</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col2\" class=\"data row12 col2\" >45</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col3\" class=\"data row12 col3\" >62</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row12_col4\" class=\"data row12 col4\" >90</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row13\" class=\"row_heading level0 row13\" >13</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col0\" class=\"data row13 col0\" >14</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col1\" class=\"data row13 col1\" >Student_014</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col2\" class=\"data row13 col2\" >63</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col3\" class=\"data row13 col3\" >26</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row13_col4\" class=\"data row13 col4\" >56</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row14\" class=\"row_heading level0 row14\" >14</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col0\" class=\"data row14 col0\" >15</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col1\" class=\"data row14 col1\" >Student_015</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col2\" class=\"data row14 col2\" >50</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col3\" class=\"data row14 col3\" >64</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row14_col4\" class=\"data row14 col4\" >70</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row15\" class=\"row_heading level0 row15\" >15</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col0\" class=\"data row15 col0\" >16</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col1\" class=\"data row15 col1\" >Student_016</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col2\" class=\"data row15 col2\" >69</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col3\" class=\"data row15 col3\" >31</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row15_col4\" class=\"data row15 col4\" >96</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row16\" class=\"row_heading level0 row16\" >16</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col0\" class=\"data row16 col0\" >17</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col1\" class=\"data row16 col1\" >Student_017</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col2\" class=\"data row16 col2\" >98</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col3\" class=\"data row16 col3\" >78</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row16_col4\" class=\"data row16 col4\" >55</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row17\" class=\"row_heading level0 row17\" >17</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col0\" class=\"data row17 col0\" >18</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col1\" class=\"data row17 col1\" >Student_018</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col2\" class=\"data row17 col2\" >65</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col3\" class=\"data row17 col3\" >74</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row17_col4\" class=\"data row17 col4\" >95</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row18\" class=\"row_heading level0 row18\" >18</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col0\" class=\"data row18 col0\" >19</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col1\" class=\"data row18 col1\" >Student_019</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col2\" class=\"data row18 col2\" >95</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col3\" class=\"data row18 col3\" >51</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row18_col4\" class=\"data row18 col4\" >61</td> \n",
       "    </tr>    <tr> \n",
       "        <th id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760level0_row19\" class=\"row_heading level0 row19\" >19</th> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col0\" class=\"data row19 col0\" >20</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col1\" class=\"data row19 col1\" >Student_020</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col2\" class=\"data row19 col2\" >83</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col3\" class=\"data row19 col3\" >72</td> \n",
       "        <td id=\"T_9e85a7b4_d8cd_11e8_82ad_787b8aac0760row19_col4\" class=\"data row19 col4\" >82</td> \n",
       "    </tr></tbody> \n",
       "</table> "
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x1113a8ba8>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandasVersusExcel\n",
    "# http://sa.mentorx.net/course/89/tasks\n",
    "# 第二十五课 条件格式化（上）\n",
    "# 2018-10-26\n",
    "\n",
    "import pandas as pd \n",
    "\n",
    "def low_score_red(s):\n",
    "    color = 'red' if s < 60 else 'black'\n",
    "    return f'color:{color}'\n",
    "\n",
    "def highest_score_green(col):\n",
    "    return ['background-color:lime' if s == col.max() else 'background-color:white' for s in col]\n",
    "\n",
    "students = pd.read_excel('./Students.xlsx')\n",
    "print('----原始数据----')\n",
    "print(students)\n",
    "print(students.columns)\n",
    "    \n",
    "students.style.applymap(low_score_red, subset=['Test_1', 'Test_2', 'Test_3']) \\\n",
    ".apply(highest_score_green, subset=['Test_1', 'Test_2', 'Test_3'])\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
